Skip to main content

All Questions

33votes
5answers
7kviews

Why do we need enums in dynamically typed languages?

I was reading some code here and saw that an enum is used to store names of html tags. Why do we ever need to do this? What benefit do I get using this strategy? I know that how useful enums are in ...
CodeYogi's user avatar
43votes
6answers
14kviews

Should I place functions that are only used in one other function, within that function?

Specifically, I'm writing in JavaScript. Let's say my primary function is Function A. If Function A makes several calls to Function B, but Function B is not used anywhere else, then should I just ...
Gary's user avatar
  • 533

close